package com.itheima.service.impl;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.dao.DeptMapper;
import com.itheima.pojo.Dept;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class TestDeptServiceTwo implements com.itheima.service.TestDeptServiceTwo {
    @Resource
    DeptMapper deptMapper;
    @Override
    @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
    public int insertDeptTwo() {
        Dept dept = new Dept();
        dept.setName("测试插入Two");
        deptMapper.insert(dept);
        return 0;
    }
}
